<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>hello</title>
		<script src="js/echarts.min.js"></script>
		<script src="js/jquery-3.4.0.min.js"></script>

		<!-- //按日期展示访问次数(饼状图) -->
		<div id="visit_times" style="width: 600px;height: 400px;">
			<script type="text/javascript">
				var myEchar = echarts.init(document.getElementById('visit_times'));
				// myEchar.showLoading();
				myUser = {
					"userid": 1
				}
				$.ajax({
					contentType: "application/json;charset=utf-8",
					type: "put",
					url: "http://localhost:8082/mylog/getEcharts",
					data: JSON.stringify(myUser),
					dataType: "json",
					success: function(res) {
						console.log(res);
						if (res) {
							myEchar.hideLoading();
							console.log(res);
							myEchar.setOption({
								title: {
									text: '系统分析用户',
									left: 'center'
								},
								tooltip: {
									trigger: 'item'
								},
								legend: {
									orient: 'vertical',
									left: 'left'
								},
								series: [{
									type: 'pie',
									radius: '50%',
									data: res,
									emphasis: {
										itemStype: {
											shadowBlur: 10,
											shadowOffsetX: 0,
											shadowColor: 'rgba{0, 0, 0, 0.5}'
										}
									}
								}]
							});
						}
					},
					error: function(errorMag) {
						alert("用户状态分析数据加载失败");
						myEchar.hideLoading();
					}
				});
			</script>
		</div>
		

		<br />
		
	</head>
	<body>
	</body>
</html>
